package com.gupao.pattern.factory.demo.simplefactory;

public class ProductCarFactory {

    public IProductCar create(Class<? extends IProductCar> clazz) {
        try {
            if (clazz != null) {
                return clazz.newInstance();
            }
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }

}
